/**
 * 用户信息模块
 */
const express = require("express");
const router = express.Router();
const { userInfoHandle, updateUserInfo, updatePwd, updateAva } = require('../router_handler/userInfo')
// 验证数据的合法性
const expressJoi = require('@escook/express-joi')
const { update_userInfo_schema,update_password_schema,update_avatar_schema } = require('../schema/user')

// 获取用户信息
router.get('/userInfo', userInfoHandle)

// 更新用户基本信息
router.post('/updateUserInfo', expressJoi(update_userInfo_schema), updateUserInfo)

// 修改密码
router.post('/updatepwd',expressJoi(update_password_schema),updatePwd)

// 更新用户头像
router.post('/updateAva',expressJoi(update_avatar_schema),updateAva)

module.exports = router
